<?php
include 'include/functions.php';
//set session save path
session_save_path($session_path);
// Initialize a session. 
session_start();
$count++;
$sessionId = session_id();
if(!$userID)
{
	session_destroy();
	header("Location: login.html"); /* Redirect browser */
	/* Make sure that code below does not get executed when we redirect. */
	exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//Dtd html 4.01 Transitional//EN"
"http://www.w3.org/tr/html4/loose.dtd">
<html>
  <head>
  <title>JoshHughes.com NFL Football Pool</title>  
	<link rel="stylesheet" href="http://football.joshhughes.com/css/football.css" type="text/css">
</head>
<body>
<Table bgcolor="#FFFFFF" width="100%" height="100%" cellpadding="0" cellspacing="0">
	<TR bgcolor="#FFFFFF">
	  <TD colspan="2" align="Left" height="1"><p>Logged in as <B><a href="members.php?ID=<?=$userID?>" class="permLink" target="_parent"><?=$username?></a></B></p>
		<B>Preferences:</B>
	  </TD>
	</TR>
	<TR bgcolor="#FFFFFF">
	  <TD height="1">&nbsp;</TD>
	  <TD height="1">
		<a href="http://football.joshhughes.com/editprofile.php" target="_parent" class="permLink">Edit Profile</a><BR>
		<a href="http://football.joshhughes.com/change.php?update=password" target="_parent" class="permLink">Change Password</a><BR>
		<a href="http://football.joshhughes.com/change.php?update=emailprefs" target="_parent" class="permLink">Change Email Prefs</a><BR>
		<a href="http://football.joshhughes.com/invite.php" target="_parent" class="permLink">Invite A Friend!</a><BR>
		<?
			if ($userID == 1) {//if user logged in is the Administrator
				echo "&nbsp;&nbsp;<a href=\"http://football.joshhughes.com/dbupdate.php?update=userscores\" target=\"_parent\" target=\"_parent\" class=\"permLink\" style=\"font-size:0.8em\">Update User Scores</a><BR />";
				echo "&nbsp;&nbsp;<a href=\"http://football.joshhughes.com/dbupdate.php?update=ranks\" target=\"_parent\" class=\"permLink\" style=\"font-size:0.8em\">Update User Ranks</a><BR />";
				echo "&nbsp;&nbsp;<a href=\"http://football.joshhughes.com/dbupdate.php?update=teams\" target=\"_parent\" class=\"permLink\" style=\"font-size:0.8em\">Update Team Records</a><BR />";
				echo "&nbsp;&nbsp;<a href=\"http://football.joshhughes.com/winners.php\" target=\"_parent\" class=\"permLink\" style=\"font-size:0.8em\">Update Winners</a> <a href=\"http://football.joshhughes.com/winners.php?League=AFL\" target=\"_parent\" class=\"permLink\" style=\"font-size:0.75em\">AFL</a><BR />";
				echo "&nbsp;&nbsp;<a href=\"http://football.joshhughes.com/autorun/tuesdayemail.php\" target=\"_parent\" class=\"permLink\" style=\"font-size:0.8em\">Tuesday Email</a><BR />";
			} else {
				echo "<img src=\"http://football.joshhughes.com/images/house.png\"> <a target=\"_self\" href=\"#\" onClick=\"this.style.behavior='url(#default#homepage)';this.setHomePage('http://football.joshhughes.com/');\">Set As Homepage</a><BR>";
				echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a target=\"_self\" href=\"javascript:window.external.AddFavorite('http://football.joshhughes.com/', 'Football Pool @ JoshHughes.com')\" target=\"_parent\" class=\"permLink\">Add To Favorites</a><BR>";
			}
		?>
	  </TD>
	</TR>
	<TR>
	   <TD>&nbsp;</TD><TD>&nbsp;</TD>
	</TR>
  </Table>
  </body>
</html>